<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="UTF-8"%>
<%@include file="/lib/common/basedir.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
<%@include file="/lib/common/headerResource.html"%>
<!--sidebar-->
<link href="<%=basedir%>/lib/css/sidebar.css" rel="stylesheet">
<title>profile</title>

<style>
.content {
	margin-top: 3.8em;
}

.title {
	font-size: 1.3em;
}

.position {
	padding-left: 1.8em;
}

.line {
	margin-bottom: 3em;
}

.operation {
	margin-left: 1em;
}

.operation a {
	font-size: 0.9em;
	text-decoration: none;
}
</style>
</head>
<body>
	<div class="container-fluid">
		<div class="row">
			<!--左侧导航-->
			<div class="col-sm-3 col-md-2 sidebar">
				<%@include file="../sidebar.jsp"%>
			</div>
			<!--右面板-->
			<div
				class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 rightPanel">
				<div class="col-md-10">
					<div class="row">
						<ul class="nav nav-tabs">
							<li role="presentation" class="active"><a href="<%=basedir %>/member/profile">关于我</a></li>
							<li role="presentation"><a href="<%=basedir %>/member/profile/consumptionHistory">消费记录</a></li>
							<li role="presentation"><a href="<%=basedir %>/member/profile/renewalHisory">充值记录</a></li>
						</ul>
					</div>
					<form class="form-horizontal content">
						<div class="form-group line">
							<div class="row">
								<span class="title position">昵称：<%=request.getAttribute("userName") %></span>
							</div>
						</div>
						<div class="form-group line">
							<div class="row">
								<span class="title position">性别：<%=request.getAttribute("gender") %></span>
							</div>
						</div>
						<div class="form-group line">
							<div class="row">
								<span class="title position">年龄：<%=request.getAttribute("age") %></span>
							</div>
						</div>
						<div class="form-group line">
							<div class="row">
								<span class="title position">居住地：<%=request.getAttribute("address") %></span>
							</div>
						</div>

						<div class="form-group line">
							<div class="row">
								<span class="title position">密码：******</span> <span
									class="operation" data-toggle="modal"
									data-target="#modifyPwd"><a href="#">修改密码</a></span>
							</div>
						</div>

						<div class="form-group line">
							<div class="col-md-2 ">
								<button type="button" class="btn btn-default  btn-block" data-toggle="modal"
									data-target="#modifyProfile">修改</button>
							</div>
						</div>
						
					<%if(request.getAttribute("failedMsg")!=null){ %>	
					<div class="alert alert-danger alert-dismissible col-md-4"  role="alert">
						<button type="button" class="close" data-dismiss="alert"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<%=request.getAttribute("failedMsg") %>
					</div>
					<%}else{} %>
					
					<%if(request.getAttribute("successMsg")!=null){ %>	
					<div class="alert alert-success alert-dismissible col-md-4"  role="alert">
						<button type="button" class="close" data-dismiss="alert"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<%=request.getAttribute("successMsg") %>
					</div>
					<%}else{} %>
					
					</form>
				</div>
			</div>
		</div>
	</div>

	<div class="modal fade" id="modifyPwd" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog modal-sm" role="document">
			<div class="modal-content">
				<div class="modal-body">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<h3 class="modal-title" id="exampleModalLabel">修改密码</h3>
					</div>
					<div class="modal-body">
						<form name="updatePwd" method="post" action="<%=basedir %>/member/profile/updatePwd">
							<div class="form-group">
								<label for="recipient-name" class="control-label">原密码:</label>
								<input type="password" name="old-pwd" class="form-control" id="old-pwd">
							</div>
							<div class="form-group">
								<label for="message-text" class="control-label">新密码:</label>
								<input type="password" name="new-pwd" class="form-control" id="new-pwd">
							</div>
						</form>
					</div>

					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
						<button type="button" class="btn btn-primary" onClick="submitPwd()">save</button>
					</div>
				</div>

			</div>
		</div>
	</div>
	
	<div class="modal fade" id="modifyProfile" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog modal-sm" role="document">
			<div class="modal-content">
				<div class="modal-body">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<h3 class="modal-title" id="exampleModalLabel">修改个人信息</h3>
					</div>
					<div class="modal-body">
						<form name="profile" method="post" action="<%=basedir %>/member/profile/update" >
							<div class="form-group">
								<label for="recipient-name" class="control-label">性别:</label>
								<input type="text" name="gender" class="form-control" id="gender">
							</div>
							<div class="form-group">
								<label for="message-text" class="control-label">年龄:</label>
								<input type="text" name="age" class="form-control" id="age">
							</div>
							<div class="form-group">
								<label for="message-text" class="control-label">居住地:</label>
								<input type="text" name="address" class="form-control" id="address">
							</div>
						</form>
					</div>

					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
						<button type="submit" class="btn btn-primary" onclick="submitProfile()">save</button>
					</div>
				</div>

			</div>
		</div>
	</div>

	<!-- jquery and bootstrap js -->
	<%@include file="/lib/common/footerResource.html"%>
	
	<script>
	function submitProfile(){
		document.profile.submit();
	}
	function submitPwd(){
		document.updatePwd.submit();
	}
	</script>

</body>
</html>